package com.yj.jason.jsondemo.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.yj.jason.baselibrary.base.BaseFragment;
import com.yj.jason.jsondemo.R;

public class Fragment04 extends BaseFragment{

    private TextView tv;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragmet01,container,false);

        tv=view.findViewById(R.id.tv);
        return view;
    }

    @Override
    public View getLayoutView() {
        return null;
    }

    @Override
    protected void onFragmentVisibleChange(boolean isVisible) {
        super.onFragmentVisibleChange(isVisible);

        if(isVisible) {
            Log.i("tag","fragment01显示");

            tv.setText("大家好  我是   4");

        }else {
            Log.i("tag","fragment01 隐藏");
        }
    }


    @Override
    protected void onFragmentFirstVisible() {
        super.onFragmentFirstVisible();

        Log.i("tag","fragment04第一次加载");

    }
}

